home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / machserver / 1.098 / dev / sun3.md / devVidSun3.s < prev    next >
Text File  |  1989-07-14  |  2KB  |  75 lines

  1. |*
  2. |* devVidSun3.s --
  3. |*
  4. |*    Routines to manipulate video memory on a Sun-3.
  5. |*
  6. |* Copyright 1987 Regents of the University of California
  7. |* All rights reserved.
  8. |*
  9.  
  10. #ifdef sun3
  11.  
  12.     .data
  13.     .asciz "$Header: /sprite/src/kernel/dev.new/sun3.md/RCS/devVidSun3.s,v 8.2 89/05/18 17:32:25 rab Exp $ SPRITE (Berkeley)"
  14.     .even
  15.     .text
  16.  
  17. #include "vmSunConst.h"
  18.  
  19. |*----------------------------------------------------------------------
  20. |*
  21. |*  Dev_VidEnable --
  22. |*
  23. |*    Enables or disables the video display on a Sun-3.
  24. |*    The Sun-3 video memory is enabled and disabled by manipulating the 3rd
  25. |*    bit (mask=0x8) in the system enable register. The S.E.R. is 
  26. |*    in MMU space.
  27. |*
  28. |*    See Sun-3 Architecture Manual (v2.0, 15 July 1986), p. 15.
  29. |*
  30. |*  Calling format:
  31. |*    Boolean onOff;
  32. |*    status = Dev_VidEnable(onOff);
  33. |*
  34. |*  Results:
  35. |*    SUCCESS    - always returned (because it's a system call).
  36. |*
  37. |*  Side Effects:
  38. |*    The deisply is enabled or disabled.
  39. |*
  40. |*----------------------------------------------------------------------
  41.  
  42. #define VIDEO_ENABLE_BIT    0x8
  43.  
  44.     .text
  45.     .globl     _Dev_VidEnable
  46. _Dev_VidEnable:
  47.     movl    d2,sp@-            | save d2
  48.     movc    sfc,d1            | Save source function code
  49.     movl    #VMMACH_MMU_SPACE,d0    | Put code for MMU space into d0
  50.     movc    d0,sfc            | Set source function code 
  51.     movsb    VMMACH_SYSTEM_ENABLE_REG,d2    | d2 = copy of system enable reg
  52.  
  53.     tstl    sp@(8)            | is arg TRUE or FALSE?
  54.     jeq        off
  55.     orb     #VIDEO_ENABLE_BIT,d2    | On: Set enable video bit
  56.     jmp        done
  57. off:
  58.     andb    #~VIDEO_ENABLE_BIT,d2    | Turn off enable video bit
  59. done:
  60.     movc    d1,sfc            | Restore prev. source function code
  61.  
  62.     movc    dfc,d1            | Save dest. function code
  63.     movl    #VMMACH_MMU_SPACE,d0    | Put code for MMU space into d0
  64.     movc    d0,dfc            | Set dest. function code 
  65.  
  66.     movsb    d2, VMMACH_SYSTEM_ENABLE_REG 
  67.  
  68.     movc    d1,dfc            | Restore prev. dest. function code
  69.  
  70.     movl    sp@+,d2            | Restore d2
  71.     movl    #0, d0            | Return SUCCESS
  72.     rts
  73.  
  74. #endif /* sun3 */
  75.